package pw.yumc.Residence.runnable;

import org.bukkit.Bukkit;

import pw.yumc.Residence.ResidenceMain;

public class AutoSaveTask implements Runnable {
    ResidenceMain res;

    public AutoSaveTask(final ResidenceMain res) {
        this.res = res;
    }

    @Override
    public void run() {
        try {
            if (res.isInit()) {
                res.saveYml();
            }
        } catch (final Exception ex) {
            Bukkit.getLogger().warning("领地数据保存错误,可能造成部分领地丢失,请尝试恢复备份文件!");
        }
    }

}
